home *** CD-ROM | disk | FTP | other *** search
- Path: news.iosphere.net!ianq
- From: ianq@sonetis.com (Ian V. Quickmire)
- Newsgroups: comp.lang.c
- Subject: Memory Allocation and Pointer
- Date: Thu, 29 Feb 96 20:56:16 GMT
- Organization: IQ Systems Ltd.
- Distribution: inet
- Message-ID: <4h53tg$3q0_001@rmoc.on.ca>
- NNTP-Posting-Host: port005-24-yow.iosphere.net
- X-Newsreader: News Xpress Version 1.0 Beta #3
-
- I am using a proprietary Windows32 RAD application to allocate memory so that
- when an ODBC DLL I am writing is called, the DLL can read the resultant
- string in said memory location.
-
- Problem I am having is seeing what is in the memory location. Probably my
- fault in dealing with pointers, hopefully someone can kick start me so that I
- see my error.
-
- The application allocates a piece of memory, casting it as a character string
- 60 bytes long.
-
- It then sends the address of said memory to my DLL as a pointer to int, at
- least according to the app's H file.
-
- The definition in the app's H file for the function used to send the address
- is:
-
- fnsend(int *pValue)
-
- My DLL defines an int rValue, and then receives the passed parm as:
-
- fnsend(&rValue)
-
- The resultant rValue = the address sent in pValue.
-
- The problem I see is that I am receiving the address as a value, not as an
- address to memory where a string is stored.
-
- What need I define in my DLL to receive the address as an address so that I
- may retrieve the string stored in memory at stated address? All I have
- figured out is how to retrieve the address, not the data at the address.
-
- Okay, shoot me then!
-
- --------------------------------------------------------------
- Work: izq00@ccc.amdahl.com Home: ianq@sonetis.com
- WWW: http://www.sonetis.com/~ianq/ CIS: 74032,573
- --------------------------------------------------------------
-